package com.baizhiedu.config;

import com.baizhiedu.injection.UserDao;
import com.baizhiedu.injection.UserService;
import com.baizhiedu.injection.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * ClassName: AppConfig3
 * Description:
 * Date: 2022/12/03 PM 11:31:23
 * <p>
 * project: spring5
 * package: com.baizhiedu.config
 * email: 1085844536@qq.com
 * version:
 *
 * @author WangGuojian
 */
@Configuration
@ComponentScan(basePackages = "com.baizhiedu.injection")
public class AppConfig3 {

    @Autowired
    private UserDao userDao;

    @Bean
    public UserService userService() {
        UserServiceImpl userService = new UserServiceImpl();
        userService.setUserDao(userDao);
        return userService;
    }
}
